package pers.liu.yibandemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.time.ZoneId;

import lombok.Data;

@TableName("notification")
public class Notification {
    @TableId(type= IdType.AUTO)
    private Long notiId;
    private String notiTitle;
    private String notiContent;
    private LocalDateTime notiTimestamp;
    private String notiSender;

    public Long getNotiId() {
        return notiId;
    }

    public void setNotiId(Long notiId) {
        this.notiId = notiId;
    }

    public String getNotiTitle() {
        return notiTitle;
    }

    public void setNotiTitle(String notiTitle) {
        this.notiTitle = notiTitle;
    }

    public String getNotiContent() {
        return notiContent;
    }

    public void setNotiContent(String notiContent) {
        this.notiContent = notiContent;
    }

    public LocalDateTime getNotiTimestamp() {
        return notiTimestamp;
    }

    public void setNotiTimestamp(LocalDateTime notiTimestamp) {
        // 假设服务器时区为东八区（例如北京时间）
        ZoneId serverZoneId = ZoneId.of("Asia/Shanghai");
        this.notiTimestamp = notiTimestamp.atZone(ZoneId.of("UTC")).withZoneSameInstant(serverZoneId).toLocalDateTime();

    }

    public String getNotiSender() {
        return notiSender;
    }

    public void setNotiSender(String notiSender) {
        this.notiSender = notiSender;
    }
}
